package com.heima.media.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Component;

import java.util.concurrent.Future;

/**
 * @author: itheima
 * @create: 2022-07-31 14:53
 */
@Slf4j
@Component
public class C {

    @Async("leadnewsExecutor")
    public Future<Long> c(){
        log.info("执行C业务");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return new AsyncResult<>(2L);
    }
}
